﻿#ifndef NSWEB_HTTP_CACHING_H_
#define NSWEB_HTTP_CACHING_H_
#include "nshttp.h"



namespace nsweb
{

struct Progress
{
    uint64_t downloaded_bytes;
    uint64_t total_bytes;
};

class HttpCaching
{
public:
    HttpCaching();
    ~HttpCaching();

    //call back interface
    class Callback
    {
    public:
        virtual bool CacheProgress(const nsweb::Progress& ) = 0;
    };

    Result Sync(const char* url, const char* path, Callback * cb);

private:
    HttpConnection conn_;
};

}

#endif